3.141 \(\int (a+b \sin (c+d x)) \tan (c+d x) \, dx\)

Optimal. Leaf size=55 \[ -\frac {(a+b) \log (1-\sin (c+d x))}{2 d}-\frac {(a-b) \log (\sin (c+d x)+1)}{2 d}-\frac {b \sin (c+d x)}{d} \]

[Out]

-1/2*(a+b)*ln(1-sin(d*x+c))/d-1/2*(a-b)*ln(1+sin(d*x+c))/d-b*sin(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {2721, 774, 633, 31} \[ -\frac {(a+b) \log (1-\sin (c+d x))}{2 d}-\frac {(a-b) \log (\sin (c+d x)+1)}{2 d}-\frac {b \sin (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x])*Tan[c + d*x],x]

[Out]

-((a + b)*Log[1 - Sin[c + d*x]])/(2*d) - ((a - b)*Log[1 + Sin[c + d*x]])/(2*d) - (b*Sin[c + d*x])/d

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 633

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> With[{q = Rt[-(a*c), 2]}, Dist[e/2 + (c*d)/(2*q),
Int[1/(-q + c*x), x], x] + Dist[e/2 - (c*d)/(2*q), Int[1/(q + c*x), x], x]] /; FreeQ[{a, c, d, e}, x] && NiceS
qrtQ[-(a*c)]

Rule 774

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(e*g*x)/c, x] + Dist[1
/c, Int[(c*d*f - a*e*g + c*(e*f + d*g)*x)/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x]

Rule 2721

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int (a+b \sin (c+d x)) \tan (c+d x) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x (a+x)}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {b \sin (c+d x)}{d}-\frac {\operatorname {Subst}\left (\int \frac {-b^2-a x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=-\frac {b \sin (c+d x)}{d}+\frac {(a-b) \operatorname {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}+\frac {(a+b) \operatorname {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=-\frac {(a+b) \log (1-\sin (c+d x))}{2 d}-\frac {(a-b) \log (1+\sin (c+d x))}{2 d}-\frac {b \sin (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 38, normalized size = 0.69 \[ -\frac {a \log (\cos (c+d x))}{d}-\frac {b \sin (c+d x)}{d}+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x])*Tan[c + d*x],x]

[Out]

(b*ArcTanh[Sin[c + d*x]])/d - (a*Log[Cos[c + d*x]])/d - (b*Sin[c + d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 45, normalized size = 0.82 \[ -\frac {{\left (a - b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a + b\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, b \sin \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c),x, algorithm="fricas")

[Out]

-1/2*((a - b)*log(sin(d*x + c) + 1) + (a + b)*log(-sin(d*x + c) + 1) + 2*b*sin(d*x + c))/d

________________________________________________________________________________________

giac [B]  time = 4.25, size = 1456, normalized size = 26.47 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c),x, algorithm="giac")

[Out]

-1/2*(b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan
(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^
2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2*tan(1/2*c)^2 - b*log(
2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4
+ 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*
c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2*tan(1/2*c)^2 + a*log(4*(tan(d*x)^
4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*t
an(1/2*d*x)^2*tan(1/2*c)^2 + b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c) + 2*tan(1/2*d*
x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(1/2*d*x)*tan(1/2
*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^
2 - b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1
/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2
+ tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*d*x)^2 + a*log(4*(tan(d*x)^4*t
an(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1))*tan(
1/2*d*x)^2 - 4*b*tan(1/2*d*x)^2*tan(1/2*c) + b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4*tan(1/2*c
) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^3 + 2*tan(
1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1
))*tan(1/2*c)^2 - b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/
2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*t
an(1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1))*tan(1/2*c)^2 + a*log(4*(
tan(d*x)^4*tan(c)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^
2 + 1))*tan(1/2*c)^2 - 4*b*tan(1/2*d*x)*tan(1/2*c)^2 + b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 + 2*tan(1/2*d*x)^4
*tan(1/2*c) + 2*tan(1/2*d*x)^3*tan(1/2*c)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 - 2*tan(1/2*d*x)^
3 + 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(1/2*d*x)^2 + tan(1/2*c)^2 - 2*tan(1/2*d*x) - 2*tan(1/2*c) + 1)/(tan(1/
2*c)^2 + 1)) - b*log(2*(tan(1/2*d*x)^4*tan(1/2*c)^2 - 2*tan(1/2*d*x)^4*tan(1/2*c) - 2*tan(1/2*d*x)^3*tan(1/2*c
)^2 + tan(1/2*d*x)^4 + 2*tan(1/2*d*x)^2*tan(1/2*c)^2 + 2*tan(1/2*d*x)^3 - 2*tan(1/2*d*x)*tan(1/2*c)^2 + 2*tan(
1/2*d*x)^2 + tan(1/2*c)^2 + 2*tan(1/2*d*x) + 2*tan(1/2*c) + 1)/(tan(1/2*c)^2 + 1)) + a*log(4*(tan(d*x)^4*tan(c
)^2 - 2*tan(d*x)^3*tan(c) + tan(d*x)^2*tan(c)^2 + tan(d*x)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(c)^2 + 1)) + 4*b*ta
n(1/2*d*x) + 4*b*tan(1/2*c))/(d*tan(1/2*d*x)^2*tan(1/2*c)^2 + d*tan(1/2*d*x)^2 + d*tan(1/2*c)^2 + d)

________________________________________________________________________________________

maple [A]  time = 0.08, size = 46, normalized size = 0.84 \[ -\frac {b \sin \left (d x +c \right )}{d}+\frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}-\frac {a \ln \left (\cos \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x+c))*tan(d*x+c),x)

[Out]

-b*sin(d*x+c)/d+1/d*b*ln(sec(d*x+c)+tan(d*x+c))-1/d*a*ln(cos(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 1.15, size = 43, normalized size = 0.78 \[ -\frac {{\left (a - b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (a + b\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) + 2 \, b \sin \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c),x, algorithm="maxima")

[Out]

-1/2*((a - b)*log(sin(d*x + c) + 1) + (a + b)*log(sin(d*x + c) - 1) + 2*b*sin(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 6.64, size = 74, normalized size = 1.35 \[ \frac {a\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1\right )\,\left (a-b\right )}{d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left (a+b\right )}{d}-\frac {b\,\sin \left (c+d\,x\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(c + d*x)*(a + b*sin(c + d*x)),x)

[Out]

(a*log(tan(c/2 + (d*x)/2)^2 + 1))/d - (log(tan(c/2 + (d*x)/2) + 1)*(a - b))/d - (log(tan(c/2 + (d*x)/2) - 1)*(
a + b))/d - (b*sin(c + d*x))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \sin {\left (c + d x \right )}\right ) \tan {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x+c))*tan(d*x+c),x)

[Out]

Integral((a + b*sin(c + d*x))*tan(c + d*x), x)

________________________________________________________________________________________